<template>
  <div>{{ c_name }}</div>
</template>
<script>
import { computed, ref } from "vue";

export default {
  setup() {
    let name = ref("张三");
    let age = ref(30);
    // 计算属性简写,省去get(),只能读取不能修改
    let c_name = computed(() => {
      let aa = "法外狂徒:" + name.value;
      //   name.value = "法外狂徒:张三";
      return aa;
    });
    // 计算属性完整写法
    let c_age = computed({
        get(){
            
        },
        set(){

        }
    })

    return { c_name,c_age };
  },
};
</script>